import {Session} from "/@/utils/storage";

export const tableOption = {
    border: true,
    stripe: true,
    menuAlign: 'center',
    index: true,
    indexLabel: '序号',
    align: 'center',
    searchMenuSpan: 6,
    searchSpan:6,
    labelWidth: '160',
    indexWidth: '60',
    selection: true,
    searchEnter:true,
    searchLabelWidth: 'auto',
    searchMenuPosition: 'left',
    column: [
        {
            type: 'input',
            label: '保养模版名称',
            prop: 'careTemplateName',
            overHidden: true,
            searchLabelWidth: 110,
            search: true,
            rules: [
                {
                    required: true,
                    message: '请输入保养模版名称',
                    trigger: 'blur'
                }
            ]
        },
        {
            type: 'select',
            label: '设备名称',
            filterable: true,
            search: true,
            dicUrl:'api/admin/accessProduct/page?current=1&size=12&descs=&ascs=',
            dicHeaders: {
                authorization: 'Bearer ' + Session.get('token'),
            },
            props:{
                label:'name',
                value:'id'
            },
            dicFormatter: (data) => {
                return data.data.records
            },
            prop: 'modelName',
            overHidden: true,
            rules: [
                {
                    required: true,
                    message: '请输入型号名称',
                    trigger: 'blur'
                }
            ]
        },
        {
            type: 'input',
            label: '设备编码',
            prop: 'modelCode',
            overHidden: true,
        },
        {
            type: 'datetime',
            label: '保养起始时间',
            valueFormat: 'YYYY-MM-DD HH:mm:ss',
            prop: 'startTime',
            overHidden: true,
            rules: [
                {
                    required: true,
                    message: '请输入保养起始时间',
                    trigger: 'blur'
                }
            ]
        },
        {
            type: 'select',
            label: '保养周期设置',
            prop: 'maintenanceIntervalSelection',
            overHidden: true,
            dicData: [{value:'1',label: '30天'},{value:'2',label: '90天'},{value:'3',label: '180天'}],
            rules: [
                {
                    required: true,
                    message: '请输入保养周期',
                    trigger: 'blur'
                }
            ]
        },
        {
            type: 'input',
            label: '保养负责人',
            prop: 'headInterior',
            hide: true,
            rules: [
                {
                    required: true,
                    message: '请输入保养负责人',
                    trigger: 'blur'
                }
            ]
        },
        {
            type: 'input',
            label: '保养负责人电话',
            prop: 'headPhone',
            hide: true,
        },
        {
            type: 'input',
            label: '保养单位',
            prop: 'maintenanceUnit',
            overHidden: true,
            hide: true,

        },
        {
            type: 'input',
            label: '保养人',
            prop: 'maintenancePeople',
            overHidden: true,
            hide: true,

        },
        {
            type: 'input',
            label: '保养人电话',
            prop: 'maintenancePeoplePhone',
            hide: true,
        },
        {
            type: 'radio',
            label: '是否短信通知',
            hide: true,
            prop: 'flag',
            dicData: [{
                label: '是',
                value: '0'
            }, {
                label: '否',
                value: '1'
            }]
        },
        {
            type: 'select',
            label: '保养项',
            hide: true,
            span: 24,
            prop: 'maintenanceContent',
        },
        {
            type: 'input',
            label: '创建时间',
            prop: 'createTime',
            addDisplay: false,
            overHidden: true,
            editDisplay: false
        },
        {
            type: 'input',
            label: '修改时间',
            prop: 'updateTime',
            addDisplay: false,
            editDisplay: false,
            overHidden: true,
        },
    ]
}
